fork and kill process

fork and kill process

am 28.07.2009 10:12:33 von Aclhk Aclhk

--===============0526490626==
Content-Type: multipart/alternative; boundary="0-1748036663-1248768753=:77951"


--0-1748036663-1248768753=:77951
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: quoted-printable

i am new to writing perl in windows. I would like to achieve the same resul=
t from the following code:

$pid =3D fork();
defined $pid or die "fork($pid)\n";
if($pid == 0)
{
exec("dir");
}

sleep(10);
kill("TERM" =3D> $pid);

I would to spawn a process and kill it (including the child process) at lat=
er time.

Pls advise what code should be in windows environment. someone suggested wi=
n32::job but i failed to write a success code.=20
=0A Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ§ð=B2=
¤¡A±Ð=A7A=A6p¦ó¨¾=BDd¶Â«È! ½Ð=ABe©¹ http://=
hk.promo.yahoo.com/security/ =A4F¸Ñ§ó=A6h!
--0-1748036663-1248768753=:77951
Content-Type: text/html; charset=big5
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">i am new to writing perl in windows. I would =
like to achieve the same result from the following code:

$pid =3D fo=
rk();
defined $pid or die "fork($pid)\n";
if($pid == 0)
{
e=
xec("dir"); >}

sleep(10);
kill("TERM" =3D> $pid);

I would to spawn =
a process and kill it (including the child process) at later time.

P=
ls advise what code should be in windows environment. someone suggested win=
32::job but i failed to write a success code.

=0A=

Yahoo!­»´ä´£¨Ñºô=
=A4W=A6w¥þ§ð²¤=A1A±Ð=A7A=A6p¦ó¨¾=BDd ¶Â«È! href=3D"http://hk.promo.yahoo.com/security/">=A4F¸Ñ§ó=A6h a>
--0-1748036663-1248768753=:77951--

--===============0526490626==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0526490626==--

Re: fork and kill process

am 28.07.2009 11:14:14 von Bill Luebkert

Aclhk Aclhk wrote:
> i am new to writing perl in windows. I would like to achieve the same
> result from the following code:
>
> $pid = fork();
> defined $pid or die "fork($pid)\n";
> if($pid == 0)
> {
> exec("dir");
> }
>
> sleep(10);
> kill("TERM" => $pid);
>
> I would to spawn a process and kill it (including the child process) at
> later time.
>
> Pls advise what code should be in windows environment. someone suggested
> win32::job but i failed to write a success code.

Check out Win32::Process and see if it will do what you need.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: fork and kill process

am 28.07.2009 11:16:40 von Aclhk Aclhk

--===============2028940081==
Content-Type: multipart/alternative; boundary="0-2121570317-1248772600=:49310"


--0-2121570317-1248772600=:49310
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: quoted-printable

if we use Win32::Process, we could not kill all associated child processes.

--- 2009=A6~7¤ë28¤é P´Á=A4G=A1ABill Luebkert nner.com> =BCg=B9D=A1R

=B1H¥ó=A4H: Bill Luebkert
=A5D=C3D: Re: fork and kill process
¦¬¥ó=A4H: "Aclhk Aclhk"
°Æ¥»(CC): activeperl@listserv.ActiveState.com
¤é´Á: 2009=A6~7¤ë28¤é,P´Á=A4G,=A4W¤È9:14

Aclhk Aclhk wrote:
> i am new to writing perl in windows. I would like to achieve the same=20
> result from the following code:
>=20
> $pid =3D fork();
> defined $pid or die "fork($pid)\n";
> if($pid == 0)
> {
> exec("dir");
> }
>=20
> sleep(10);
> kill("TERM" =3D> $pid);
>=20
> I would to spawn a process and kill it (including the child process) at=
=20
> later time.
>=20
> Pls advise what code should be in windows environment. someone suggested=
=20
> win32::job but i failed to write a success code.

Check out Win32::Process and see if it will do what you need.
=0A Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ§ð=B2=
¤¡A±Ð=A7A=A6p¦ó¨¾=BDd¶Â«È! ½Ð=ABe©¹ http://=
hk.promo.yahoo.com/security/ =A4F¸Ñ§ó=A6h!
--0-2121570317-1248772600=:49310
Content-Type: text/html; charset=big5
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">if we use Win32::Process, we could not kill a=
ll associated child processes.

--- 2009=A6~7¤ë28¤é P=
´Á=A4G=A1ABill Luebkert <dbecoll@roadrunner.com>
=BCg=
=B9D=A1R
argin-left: 5px; padding-left: 5px;">
=B1H¥ó=A4H: Bill Luebkert <=
dbecoll@roadrunner.com>
=A5D=C3D: Re: fork and kill process
¦¬=
¥ó=A4H: "Aclhk Aclhk" <aclhkaclhk@ymail.com>
°Æ¥»(CC):=
activeperl@listserv.ActiveState.com
¤é´Á: 2009=A6~7¤ë28=A4=
=E9,P´Á=A4G,=A4W¤È9:14

Aclhk Acl=
hk wrote:
> i am new to writing perl in windows. I would like to achi=
eve the same
> result from the following code:
>
> $pid=
=3D fork();
> defined $pid or die "fork($pid)\n";
> if($pid =
== 0)
> {
> exec("dir");
> }
>
>
sleep(10);
> kill("TERM" =3D> $pid);
>
> I would to =
spawn a process and kill it (including the child process) at
> later=
time.
>
> Pls advise what code should be in windows environme=
nt. someone suggested
> win32::job but i failed to write a success c=
ode.

Check out Win32::Process and see if it will do what you need. r>

=0A
ize=3D1>Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ=A 7𲤡A=
±Ð=A7A=A6p¦ó¨¾=BDd¶Â«È! ..com/security/">=A4F¸Ñ§ó=A6h
--0-2121570317-1248772600=:49310--

--===============2028940081==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============2028940081==--

Re: fork and kill process

am 28.07.2009 11:18:15 von Aclhk Aclhk

--===============0746222600==
Content-Type: multipart/alternative; boundary="0-682413912-1248772695=:3704"


--0-682413912-1248772695=:3704
Content-Type: text/plain; charset=big5
Content-Transfer-Encoding: quoted-printable

fork is ok but forked process could not be killed.=20

--- 2009=A6~7¤ë28¤é P´Á=A4G=A1AXiao Yafeng om> =BCg=B9D=A1R

=B1H¥ó=A4H: Xiao Yafeng
=A5D=C3D: Re: fork and kill process
¦¬¥ó=A4H: "Aclhk Aclhk"
¤é´Á: 2009=A6~7¤ë28¤é,P´Á=A4G,=A4W¤È8:39

Using fork function on window is no problem. Below code spawns 10 processes=
and print in turn:=20
use strict;
use warnings;


my $max_process =3D 10;

my $processes =3D 0;
for my $count (1..100){
wait if $processes >=3D $max_process;
do{print $count."\n";exit} unless my $pid =3D fork;
$processes ++;
}

I roughly remember $pid of child process may not be zero on window. below o=
ne line could prove whether my guess is right or not:=20

perl -e 'if($pid =3D fork){print "parent pid is".$pid."\n";}else{print "chi=
ld pid is".$pid,"\n";}'




2009/7/28 Aclhk Aclhk
i am new to writing perl in windows. I would like to achieve the same=
result from the following code:

$pid =3D fork();
defined $pid or die "fork($pid)\n";
if($pid == 0)
{
exec("dir");
=0A}

sleep(10);
kill("TERM" =3D> $pid);

I would to spawn a process and kill it (including the child process) at lat=
er time.

Pls advise what code should be in windows environment. someone suggested wi=
n32::job but i failed to write a success code.=20
=0A
=0A Yahoo!­»´ä´£¨Ñºô=A4W=A6w=A5=
þ§ð²¤¡A±Ð=A7A=A6p¦ó¨¾=BDd¶Â=AB=C 8!=A4F¸Ñ=A7=
ó¦h
_______________________________________________
=0AActivePerl mailing list
=0AActivePerl@listserv.ActiveState.com
=0ATo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ§ð=
²¤=A1A±Ð=A7A=A6p¦ó¨¾=BDd¶Â«È! ½Ð=ABe©¹ http=
://hk.promo.yahoo.com/security/ =A4F¸Ñ§ó=A6h!
--0-682413912-1248772695=:3704
Content-Type: text/html; charset=big5
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">fork is ok but forked process could not be ki=
lled.

--- 2009=A6~7¤ë28¤é P´Á=A4G=A1AXiao Yafeng =
<xyf.xiao@gmail.com>
=BCg=B9D=A1R
border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5p=
x;">
=B1H¥ó=A4H: Xiao Yafeng <xyf.xiao@gmail.com>
=A5D=C3D:=
Re: fork and kill process
¦¬¥ó=A4H: "Aclhk Aclhk" <aclhkaclh=
k@ymail.com>
¤é´Á: 2009=A6~7¤ë28¤é,P´Á=A4G,=A4=
W¤È8:39

Using fork function on window i=
s no problem. Below code spawns 10 processes and print in turn:
ass=3D"code">use strict;=

use warnings;


my $max_process =3D 10;

my $processes =
=3D 0;
for my $count (1..100){
wait if $processes >=3D $max_pr=
ocess;
do{print $count."\n";exit} unless my $pid =3D fork;
=20
$processes ++;
}

I roughly remember $pid of child process may no=
t be zero on window. below one line could prove whether my guess is right o=
r not:

perl -e 'if($pid =3D fork){pri=
nt "parent pid is".$pid."\n";}else{print "child pid is".$pid,"\n";}'
>


2009/7/28 Aclhk Aclhk ltr">< =3D"_blank" href=3D"/mc/compose?to=3Daclhkaclhk@ymail.com">aclhkaclhk@ym ail=
..com
>

=0A
-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-lef=
t: 1ex;"> >
rit; font-weight: inherit; font-size: inherit; line-height: inherit; font-s=
ize-adjust: inherit; font-stretch: inherit;" valign=3D"top">=0Ai am new to =
writing perl in windows. I would like to achieve the same result from the f=
ollowing code:

$pid =3D fork();
defined $pid or die "fork($pid)\n=
";
if($pid == 0)
{
exec(" line;">dir");
=0A}

sleep(10);
kill("TERM" =3D> $pid)=
;

I would to spawn a process and kill it (including the child proces=
s) at later time.

Pls advise what code should be in windows environm=
ent. someone suggested win32::job but i failed to write a success code. >=0A

=0A
>Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ§ð=B2 ¤¡A±Ð=
=A7A=A6p¦ó¨¾=BDd¶Â«È! href=3D"http://hk.promo.yahoo.com/security/">=A4F¸Ñ§ó=A6h >
_______________________________________________
=0AActivePerl maili=
ng list
=0A
iveState.com" target=3D"_blank" href=3D"/mc/compose?to=3DActivePerl@listser=
v.ActiveState.com">ActivePerl@listserv.ActiveState.com

=0ATo unsubsc=
ribe: tate.com/mailman/mysubs">http://listserv.ActiveState.com/mai lman/mysubs=


=0A

=0A =

Yahoo!­»´ä´£¨Ñºô=A4=
W=A6w¥þ§ð²¤=A1A±Ð=A7A=A6p¦ó¨¾=BDd=B6 «=C8! ef=3D"http://hk.promo.yahoo.com/security/">=A4F¸Ñ§ó=A6h
--0-682413912-1248772695=:3704--

--===============0746222600==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0746222600==--

Re: fork and kill process

am 28.07.2009 11:23:43 von Bill Luebkert

Aclhk Aclhk wrote:
> if we use Win32::Process, we could not kill all associated child processes.

Doesn't Win32::Process::KillProcess work ?

There is no such thing as a fork in Windoze, so you
basically have to create a process (possibly detached)
and you should be able to kill it be getting the pid.

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: fork and kill process

am 28.07.2009 11:42:35 von Jan Dubois

This is a multi-part message in MIME format.

--===============1809535640==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0181_01CA0F2D.12FD1000"
Content-language: en-us

This is a multi-part message in MIME format.

------=_NextPart_000_0181_01CA0F2D.12FD1000
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Win32::Job is indeed the module to use if you want to be sure you catch =
all child processes too. It requires Windows 2000 or later.
You'll need to show us some sample code and explain how it didn't work =
for you if you expect additional help with it.

=20

As for Win32::Process, you should be able to use kill(-9, $pid) at least =
with reasonably newish ActivePerl versions to kill $pid and
all its children.

=20

Cheers,

-Jan

=20

From: activeperl-bounces@listserv.ActiveState.com =
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Aclhk =
Aclhk
Sent: Tuesday, July 28, 2009 2:17 AM
To: Bill Luebkert
Cc: activeperl@listserv.ActiveState.com
Subject: Re: fork and kill process

=20


if we use Win32::Process, we could not kill all associated child =
processes.

--- 2009Äê7ÔÂ28ÈÕ ÐÇÆÚ¶þ£¬Bill Luebkert =
Œ‘µÀ=A9s


¼Ä¼þÈË: Bill Luebkert
Ö÷=EE}: Re: fork and kill process
ÊÕ¼þÈË: "Aclhk Aclhk"
¸±±¾(CC): activeperl@listserv.ActiveState.com
ÈÕÆÚ: =
2009Äê7ÔÂ28ÈÕ,ÐÇÆÚ¶þ,ÉÏÎç9:1 4

Aclhk Aclhk wrote:
> i am new to writing perl in windows. I would like to achieve the same=20
> result from the following code:
>=20
> $pid =3D fork();
> defined $pid or die "fork($pid)\n";
> if($pid == 0)
> {
> exec("dir");
> }
>=20
> sleep(10);
> kill("TERM" =3D> $pid);
>=20
> I would to spawn a process and kill it (including the child process) =
at=20
> later time.
>=20
> Pls advise what code should be in windows environment. someone =
suggested=20
> win32::job but i failed to write a success code.

Check out Win32::Process and see if it will do what you need.

=20

_____ =20

Yahoo!Ïã¸ÛÌṩ=BEWÉÏ°²È«¹¥=C 2Ô£¬½=
ÌÄãÈçºÎ·À¹ ºÚ¿=CD! =
Á˽â¸ü¶à


------=_NextPart_000_0181_01CA0F2D.12FD1000
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

charset=3Dgb2312">
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">













style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Win32::Job is indeed the module to use if you want to be =
sure
you catch all child processes too.  It requires Windows 2000 or
later.  You'll need to show us some sample code and explain how it =
didn't
work for you if you expect additional help with =
it.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>As for Win32::Process, you should be able to use kill(-9, =
$pid) at
least with reasonably newish ActivePerl versions to kill $pid and all =
its
children.



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> 



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Cheers,



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>-Jan



style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> 



0in 4.0pt'>



0in 0in 0in'>

style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >From:=
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' >
activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of =
Aclhk
Aclhk

Sent: Tuesday, July 28, 2009 2:17 AM

To: Bill Luebkert

Cc: activeperl@listserv.ActiveState.com

Subject: Re: fork and kill process







 



cellpadding=3D0>




if we use Win32::Process, we could not kill all =
associated
child processes.



--- 2009Äê7 lang=3DZH-TW>ÔÂ28 lang=3DZH-TW>ÈÕ ÐÇÆÚ¶þ£¬Bill Luebkert =
<dbecoll@roadrunner.com>

Œ‘µÀ=A9s




¼Ä¼þÈË: Bill Luebkert =
<dbecoll@roadrunner.com>

Ö÷=EE}: Re: fork and kill process

ÊÕ¼þÈË: "Aclhk Aclhk"
<aclhkaclhk@ymail.com>

¸±±¾(CC): =
activeperl@listserv.ActiveState.com

ÈÕÆÚ: 2009 lang=3DZH-TW>Äê7ÔÂ28 lang=3DZH-TW>ÈÕ, lang=3DZH-TW>ÐÇÆÚ¶þ, lang=3DZH-TW>ÉÏÎç9:14



Aclhk Aclhk wrote:

> i am new to writing perl in windows. I would like to achieve the =
same

> result from the following code:

>

> $pid =3D fork();

> defined $pid or die "fork($pid)\n";

> if($pid == 0)

> {

> exec("dir");

> }

>

> sleep(10);

> kill("TERM" =3D> $pid);

>

> I would to spawn a process and kill it (including the child =
process) at

> later time.

>

> Pls advise what code should be in windows environment. someone =
suggested


> win32::job but i failed to write a success code.



Check out Win32::Process and see if it will do what you =
need.





style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" '> =



style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" '>






style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" '>Yahoo! n> style=3D'font-size:10.0pt;font-family:"MS =
Mincho"'>Ïã¸ÛÌṩ=BEWÉÏ°²È«=B9=A 5ÂÔ£¬=
½ÌÄãÈçºÎ·À¹ ºÚ¿Í
style=3D'font-size:10.0pt;font-family:"Calibri","sans-serif" '>! href=3D"http://hk.promo.yahoo.com/security/"> style=3D'font-family:"MS =
Mincho"'>Á˽â¸ü¶à











------=_NextPart_000_0181_01CA0F2D.12FD1000--


--===============1809535640==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1809535640==--

Re: fork and kill process

am 28.07.2009 14:45:02 von Xiao Yafeng

--===============0432130682==
Content-Type: multipart/alternative; boundary=00163646d4626c9970046fc370e8

--00163646d4626c9970046fc370e8
Content-Type: text/plain; charset=Big5
Content-Transfer-Encoding: quoted-printable

How do you know spawned process can not be killed? posting the code could
let us help you better.

2009/7/28 Aclhk Aclhk

> if we use Win32::Process, we could not kill all associated child processe=
s.
>
> --- *2009=A6~7¤ë28¤é P´Á=A4G=A1ABill Luebkert drunner.com>* =BCg=B9D=A1R
>
>
> =B1H¥ó=A4H: Bill Luebkert
> =A5D=C3D: Re: fork and kill process
> ¦¬¥ó=A4H: "Aclhk Aclhk"
> °Æ¥»(CC): activeperl@listserv.ActiveState.com
> ¤é´Á: 2009=A6~7¤ë28¤é,P´Á=A4G,=A4W¤È9:14
>
> Aclhk Aclhk wrote:
> > i am new to writing perl in windows. I would like to achieve the same
> > result from the following code:
> >
> > $pid =3D fork();
> > defined $pid or die "fork($pid)\n";
> > if($pid == 0)
> > {
> > exec("dir");
> > }
> >
> > sleep(10);
> > kill("TERM" =3D> $pid);
> >
> > I would to spawn a process and kill it (including the child process) at
> > later time.
> >
> > Pls advise what code should be in windows environment. someone suggeste=
d
> > win32::job but i failed to write a success code.
>
> Check out Win32::Process and see if it will do what you need.
>
>
> ------------------------------
> Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ§ð=B2= A4=A1A±Ð=
=A7A=A6p¦ó¨¾=BDd¶Â«È!*=A4F¸Ñ§ó=A6h* o.yahoo.com/security/>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>

--00163646d4626c9970046fc370e8
Content-Type: text/html; charset=Big5
Content-Transfer-Encoding: quoted-printable

How do you know spawned process can not be killed? posting the code could l=
et us help you better.

2009/7/28 Aclhk A=
clhk <aclhkacl=
hk@ymail.com
>


204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> 0" cellpadding=3D"0" cellspacing=3D"0">
inherit; font-style: inherit; font-variant: inherit; font-weight: inherit;=
font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-=
stretch: inherit;" valign=3D"top">
if we use Win32::Process, we could not kill all associated child processes.=


--- 2009=A6~7¤ë28¤é P´Á=A4G=A1ABill Luebkert &=
lt;dbecoll@road=
runner.com
>
=BCg=B9D=A1R

5px; padding-left: 5px;">
=B1H¥ó=A4H: Bill Luebkert < ailto:dbecoll@roadrunner.com" target=3D"_blank">dbecoll@roadrunner.com&=
gt;
=A5D=C3D: Re: fork and kill process

¦¬¥ó=A4H: "Aclhk Aclhk" < ymail.com" target=3D"_blank">aclhkaclhk@ymail.com>
°Æ¥»(C=
C): ">activeperl@listserv.ActiveState.com

¤é´Á: 2009=A6~7¤ë28¤é,P´Á=A4G,=A4W¤È9:14
ss=3D"im">

Aclhk Aclhk wrote:
> i am new to writing perl =
in windows. I would like to achieve the same
> result from the follo=
wing code:
>
> $pid =3D fork();

> defined $pid or die "fork($pid)\n";
> if($pid == 0=
)
> {
> exec("dir");
> }
>
>
sleep(10);
> kill("TERM" =3D> $pid);
>
> I=
would to spawn a process and kill it (including the child process) at
=
> later time.
>
> Pls advise what code should be in windows=
environment. someone suggested

> win32::job but i failed to write a success code.

Check out Win3=
2::Process and see if it will do what you need.
>


=20




Yahoo!­»´ä´£¨Ñºô=A4W=A6w¥þ=A7=
𲤡A±Ð=A7A=A6p¦ó¨¾=BDd¶Â«È! k.promo.yahoo.com/security/" target=3D"_blank">=A4F¸Ñ§ó=A6h<=
/a>
_______________________________________________

ActivePerl mailing list

ActivePerl@listserv.=
ActiveState.com


To unsubscribe: target=3D"_blank">http://listserv.ActiveState.com/mailman/my subs
lockquote>



--00163646d4626c9970046fc370e8--

--===============0432130682==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0432130682==--